package com.xiantm.study.thread.guardedsuspension;

public class ServerThread extends Thread {


    private final RequestQueue queue;

    public ServerThread(String name, RequestQueue queue){
        super(name);
        this.queue = queue;
    }

    @Override
    public void run() {
        while (true){
            Request request = queue.getRequest();
            System.out.println(Thread.currentThread().getName() + " handle request " + request.getName() + ".");
        }
    }

}
